package net.entelijan.cobean.bind;

public abstract class AbstractColumnBinding<C> implements IColumnBinding<C> {

    private static final long serialVersionUID = 1L;

    protected String modelProperty;

    protected String name;

    protected IPropertyBindingStrategy propertyBindingStrategy;

    public AbstractColumnBinding() {
        super();
        this.propertyBindingStrategy = BindingStrategyFactory.createBindingStrategy();
    }

    public <T> T bind(T model, C comp) {
        return this.propertyBindingStrategy.bind(model, this, comp);
    }

    public String getModelProperty() {
        return this.modelProperty;
    }

    public void setModelProperty(String modelPath) {
        this.modelProperty = modelPath;
    }

    public String getName() {
        return this.name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public IPropertyBindingStrategy getBinder() {
        return this.propertyBindingStrategy;
    }

    public void setBinder(IPropertyBindingStrategy propertyBindingStrategy) {
        this.propertyBindingStrategy = propertyBindingStrategy;
    }

}
